import React from 'react';

import { Form, Input, Button, Checkbox ,TreeSelect,Cascader} from 'antd';
import { useDispatch, useSelector } from "react-redux"
  
   

const Index = () => {

  const dispatch = useDispatch()
  // const pushsel = useSelector(state => state.getIn(["sr"]).toJS())
  // console.log(pushsel);

   const onFinish =(values)=>{

     console.log(values.area);
     dispatch({
      type: 'areadesk',
      data: values.area
  })
   }
    
    return (
        <Form
        onFinish={onFinish}
      >
        {/* <Form.Item
          label="区域名称"
        >
          <Input />
        </Form.Item> */}

        <Form.Item label="区域名称" name="area" >
          <TreeSelect
               defaultValue="c"
            treeData={[

              { title: 'A', value: 'a'},
              { title: 'B', value: 'b'},
              { title: 'C', value: 'c'},
              { title: 'D', value: 'd'},
              { title: 'E', value: 'e'},
              { title: 'F', value: 'f'},
             
            ]}
          />
        </Form.Item>
       
  
        <Form.Item label="仓库名称"  name="ck">
          <TreeSelect
          defaultValue="cj"
            treeData={[
              { title: '长江仓库', value: 'cj'},
              { title: '黄河仓库', value: 'hh'},
              { title: '黑龙江仓库', value: 'hlj'},
          
             
            ]}
          />
        </Form.Item>
  
        <Form.Item  style={{display:'flex',justifyContent:"space-between" ,width:"100%"}}>
          <Button type="primary" htmlType="submit">
            提交
          </Button>
       
        </Form.Item>
      </Form>
    );
}

export default Index;
